module MicroEventLink
  module MicroEventLinksController
    # GET /micro_event_links
    # GET /micro_event_links.xml
    def index
      @micro_event_links = MicroEventLink.find(:all)
      
      respond_to do |format|
        format.html # index.html.erb
        format.xml  { render :xml => @micro_event_links }
      end
    end
    
    # GET /micro_event_links/1
    # GET /micro_event_links/1.xml
    def show
      @micro_event_link = MicroEventLink.find(params[:id])
      
      respond_to do |format|
        format.html # show.html.erb
        format.xml  { render :xml => @micro_event_link }
      end
    end
    
    # GET /micro_event_links/new
    # GET /micro_event_links/new.xml
    def new
      @micro_event_link = MicroEventLink.new
      
      respond_to do |format|
        format.html # new.html.erb
        format.xml  { render :xml => @micro_event_link }
      end
    end
    
    # GET /micro_event_links/1/edit
    def edit
      @micro_event_link = MicroEventLink.find(params[:id])
    end
    
    # POST /micro_event_links
    # POST /micro_event_links.xml
    def create
      @micro_event_link = MicroEventLink.new(params[:micro_event_link])
      
      respond_to do |format|
        if @micro_event_link.save
          flash[:notice] = 'MicroEventLink was successfully created.'
          format.html { redirect_to(@micro_event_link) }
          format.xml  { render :xml => @micro_event_link, :status => :created, :location => @micro_event_link }
        else
          format.html { render :action => "new" }
          format.xml  { render :xml => @micro_event_link.errors, :status => :unprocessable_entity }
        end
      end
    end
    
    # PUT /micro_event_links/1
    # PUT /micro_event_links/1.xml
    def update
      @micro_event_link = MicroEventLink.find(params[:id])
      
      respond_to do |format|
        if @micro_event_link.update_attributes(params[:micro_event_link])
          flash[:notice] = 'MicroEventLink was successfully updated.'
          format.html { redirect_to(@micro_event_link) }
          format.xml  { head :ok }
        else
          format.html { render :action => "edit" }
          format.xml  { render :xml => @micro_event_link.errors, :status => :unprocessable_entity }
        end
      end
    end
    
    # DELETE /micro_event_links/1
    # DELETE /micro_event_links/1.xml
    def destroy
      @micro_event_link = MicroEventLink.find(params[:id])
      @micro_event_link.destroy
      
      respond_to do |format|
        format.html { redirect_to(micro_event_links_url) }
        format.xml  { head :ok }
      end
    end
  end
end